this.BX=this.BX||{};(function(t,e,s,i,a,l,n,o,r,p,c,u,d,h){"use strict";const m={beforeMount(t,e){d.Event.bind(t,"click",(t=>{t.preventDefault();BX.UI.Feedback.Form.open(e.value)}))}};const b={emits:["selected","unselected"],name:"ui-entity-catalog-group",props:{groupData:{type:p.GroupData,required:true}},computed:{hasIcon(){return d.Type.isStringFilled(this.groupData.icon)}},methods:{handleClick(){if(this.groupData.deselectable){this.$emit(!this.groupData.selected?"selected":"unselected",this.groupData)}else if(!this.groupData.selected){this.$emit("selected",this.groupData)}}},template:`\n\t\t<slot name="group" v-bind:groupData="groupData" v-bind:handleClick="handleClick">\n\t\t\t<li \n\t\t\t\t:class="{\n\t\t\t\t\t'ui-entity-catalog__menu_item': true,\n\t\t\t\t\t'--active': groupData.selected,\n\t\t\t\t\t'--disabled': groupData.disabled\n\t\t\t\t}"\n\t\t\t\t@click="handleClick"\n\t\t\t>\n\t\t\t\t<span class="ui-entity-catalog__menu_item-icon" v-if="hasIcon" v-html="groupData.icon"/>\n\t\t\t\t<span class="ui-entity-catalog__menu_item-text">{{ groupData.name }}</span>\n\t\t\t</li>\n\t\t</slot>\n\t`};const g={emits:["groupSelected","groupUnselected"],name:"ui-entity-selector-group-list",components:{Group:b},props:{groups:{type:Array,required:true}},methods:{handleGroupSelected(t){this.$emit("groupSelected",t)},handleGroupUnselected(t){this.$emit("groupUnselected",t)}},template:`\n\t\t<ul class="ui-entity-catalog__menu">\n\t\t\t<Group\n\t\t\t\t:group-data="group"\n\t\t\t\t:key="group.id"\n\t\t\t\tv-for="group in groups"\n\t\t\t\t@selected="handleGroupSelected"\n\t\t\t\t@unselected="handleGroupUnselected"\n\t\t\t>\n\t\t\t\t<template #group="groupSlotProps">\n\t\t\t\t\t<slot\n\t\t\t\t\t\tname="group"\n\t\t\t\t\t\tv-bind:groupData="groupSlotProps.groupData"\n\t\t\t\t\t\tv-bind:handleClick="groupSlotProps.handleClick"\n\t\t\t\t\t/>\n\t\t\t\t</template>\n\t\t\t</Group>\n\t\t</ul>\n\t`};const v={emits:["groupSelected"],name:"ui-entity-catalog-main-groups",components:{GroupList:g},props:{recentGroupData:{type:h.GroupData,required:false},groups:{type:Array,required:true},showRecentGroup:{type:Boolean,default:false},searching:{type:Boolean,default:false}},data(){var t,e;const s=this.getRecentGroup();s[0]=Object.assign(s[0],(t=this.recentGroupData)!=null?t:{});let i=(e=this.groups.find((t=>t.selected)))!=null?e:null;if(!i){var a;i=(a=s.find((t=>t.selected)))!=null?a:null}return{shownGroups:this.groups,selectedGroup:null,recentGroup:s}},watch:{selectedGroup(t){const e=t?t.id:null;this.shownGroups=this.shownGroups.map((t=>t.map((t=>({...t,selected:t.id===e})))));if(this.showRecentGroup&&e!==this.recentGroup[0].id){this.recentGroup=[Object.assign(this.recentGroup[0],{selected:false})]}this.$emit("groupSelected",t)}},beforeUpdate(){if(this.searching){this.shownGroups=this.shownGroups.map((t=>t.map((t=>({...t,selected:false})))));this.recentGroup=[Object.assign(this.recentGroup[0],{selected:false})]}},methods:{getRecentGroup(){return[{id:"recent",name:d.Loc.getMessage("UI_JS_ENTITY_CATALOG_GROUP_LIST_RECENT_GROUP_DEFAULT_NAME"),icon:`\n\t\t\t\t\t<svg width="18" height="14" viewBox="0 0 18 14" fill="none" xmlns="http://www.w3.org/2000/svg">\n\t\t\t\t\t\t<path class="ui-entity-catalog__svg-icon-blue" fill-rule="evenodd" clip-rule="evenodd" d="M9.369 13.2593C13.0305 13.2593 15.9986 10.2911 15.9986 6.62965C15.9986 2.9682 13.0305 0 9.369 0C6.00693 0 3.22939 2.50263 2.79764 5.74663H0L3.69844 9.44506L7.39687 5.74663H4.48558C4.90213 3.4276 6.93006 1.66789 9.369 1.66789C12.1093 1.66789 14.3308 3.88935 14.3308 6.62965C14.3308 9.36995 12.1093 11.5914 9.369 11.5914C9.2435 11.5914 9.11909 11.5867 8.99593 11.5776V13.249C9.11941 13.2558 9.2438 13.2593 9.369 13.2593ZM10.0865 4.01429H8.41983V8.18096H9.65978H10.0865H12.1195V6.56367H10.0865V4.01429Z"></path>\n\t\t\t\t\t</svg>\n\t\t\t\t`}]},handleGroupSelected(t){this.selectedGroup=t},handleRecentGroupSelected(t){t.selected=true;this.selectedGroup=t},handleGroupUnselected(){this.selectedGroup=null}},template:`\n\t\t<div class="ui-entity-catalog__main-groups">\n\t\t\t<div class="ui-entity-catalog__main-groups-head">\n\t\t\t\t<slot name="group-list-header"/>\n\t\t\t</div>\n\t\t\t<div class="ui-entity-catalog__recently" v-if="showRecentGroup">\n\t\t\t\t<GroupList\n\t\t\t\t\t:groups="recentGroup"\n\t\t\t\t\t@groupSelected="handleRecentGroupSelected"\n\t\t\t\t\t@groupUnselected="handleGroupUnselected"\n\t\t\t\t>\n\t\t\t\t\t<template #group="groupSlotProps">\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname="group"\n\t\t\t\t\t\t\tv-bind:groupData="groupSlotProps.groupData"\n\t\t\t\t\t\t\tv-bind:handleClick="groupSlotProps.handleClick"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</template>\n\t\t\t\t</GroupList>\n\t\t\t</div>\n\t\t\t<div class="ui-entity-catalog__main-groups-content">\n\t\t\t\t<GroupList\n\t\t\t\t\t:groups="groupList"\n\t\t\t\t\tv-for="groupList in shownGroups"\n\t\t\t\t\t@groupSelected="handleGroupSelected"\n\t\t\t\t\t@groupUnselected="handleGroupUnselected"\n\t\t\t\t>\n\t\t\t\t\t<template #group="groupSlotProps">\n\t\t\t\t\t\t<slot\n\t\t\t\t\t\t\tname="group"\n\t\t\t\t\t\t\tv-bind:groupData="groupSlotProps.groupData"\n\t\t\t\t\t\t\tv-bind:handleClick="groupSlotProps.handleClick"\n\t\t\t\t\t\t/>\n\t\t\t\t\t</template>\n\t\t\t\t</GroupList>\n\t\t\t</div>\n\t\t\t<div class="ui-entity-catalog__main-groups-footer">\n\t\t\t\t<slot name="group-list-footer"/>\n\t\t\t</div>\n\t\t</div>\n\t`};const _={name:"ui-entity-catalog-item-list-advice",props:{groupData:{type:p.GroupData,required:true}},computed:{getAvatar:function(){return d.Type.isStringFilled(this.groupData.adviceAvatar)?this.groupData.adviceAvatar:"/bitrix/js/ui/entity-catalog/images/ui-entity-catalog--nata.jpg"}},methods:{renderAdvice(){d.Dom.clean(this.$refs.container);const t=new l.Advice({content:this.groupData.adviceTitle,avatarImg:this.getAvatar,anglePosition:l.Advice.AnglePosition.BOTTOM});t.renderTo(this.$refs.container)}},mounted(){this.renderAdvice()},updated(){this.renderAdvice()},template:`\n\t\t<div ref="container"></div>\n\t`};const T={name:"ui-entity-catalog-button",props:{buttonData:{type:o.ButtonData,required:true},eventData:{type:Object,required:true}},computed:{buttonText(){return d.Type.isStringFilled(this.buttonData.text)?this.buttonData.text:d.Loc.getMessage("UI_JS_ENTITY_CATALOG_ITEM_DEFAULT_BUTTON_TEXT")}},methods:{handleButtonClick(t){const e=new u.BaseEvent({data:{eventData:this.eventData,originalEvent:t}});if(d.Type.isFunction(this.buttonData.action)){this.buttonData.action.call(this,e)}}},template:`\n\t\t<div class="ui-entity-catalog__option-btn-block">\n\t\t\t<div \n\t\t\t\tclass="ui-entity-catalog__btn"\n\t\t\t\t:class="{'--lock': buttonData.locked}"\n\t\t\t\t@click="handleButtonClick"\n\t\t\t>{{buttonText}}</div>\n\t\t</div>\n\t`};const f={name:"ui-entity-catalog-item",components:{Button:T},props:{itemData:{type:n.ItemData,required:true}},computed:{buttonData(){if(!d.Type.isPlainObject(this.itemData.button)){this.itemData.button={}}return this.itemData.button}},template:`\n\t\t<slot name="item" v-bind:itemData="itemData">\n\t\t\t<div class="ui-entity-catalog__option">\n\t\t\t\t<div class="ui-entity-catalog__option-info">\n\t\t\t\t\t<div class="ui-entity-catalog__option-info_name">\n\t\t\t\t\t\t<span>{{itemData.title}}</span>\n\t\t\t\t\t\t<span class="ui-entity-catalog__option-info_label" v-if="itemData.subtitle">{{itemData.subtitle}}</span>\n\t\t\t\t\t</div>\n\t\t\t\t\t<div class="ui-entity-catalog__option-info_description">\n\t\t\t\t\t\t{{itemData.description}}\n\t\t\t\t\t</div>\n\t\t\t\t</div>\n\t\t\t\t<Button :buttonData="buttonData" :event-data="itemData"/>\n\t\t\t</div>\n\t\t</slot>\n\t`};const y={name:"ui-entity-selector-item-list",components:{Item:f},props:{items:{Type:Array,required:true}},template:`\n\t\t<div class="ui-entity-catalog__content">\n\t\t\t<div class="ui-entity-catalog__options">\n\t\t\t\t<Item \n\t\t\t\t\t:item-data="item"\n\t\t\t\t\t:key="item.id"\n\t\t\t\t\tv-for="item in items"\n\t\t\t\t>\n\t\t\t\t\t<template #item="itemSlotProps">\n\t\t\t\t\t\t<slot name="item" v-bind:itemData="itemSlotProps.itemData"/>\n\t\t\t\t\t</template>\n\t\t\t\t</Item>\n\t\t\t</div>\n\t\t</div>\n\t`};const S={template:`\n\t\t<div class="ui-entity-catalog__content --help-block">\n\t\t\t<div class="ui-entity-catalog__empty-content">\n\t\t\t\t<div class="ui-entity-catalog__empty-content_icon">\n\t\t\t\t\t<img src="/bitrix/js/ui/entity-catalog/images/ui-entity-catalog--search-icon.svg" alt="Choose a grouping">\n\t\t\t\t</div>\n\t\t\t\t<div class="ui-entity-catalog__empty-content_text">\n\t\t\t\t\t<slot/>\n\t\t\t\t</div>\n\t\t\t</div>\n\t\t</div>\n\t\t`};const P=r.defineStore("global-state",{state:()=>({searchApplied:false,filtersApplied:false,currentGroup:p.GroupData,shouldShowWelcomeStub:true})});const L={name:"ui-entity-catalog-main-content",components:{ItemListAdvice:_,ItemList:y,EmptyContent:S},props:{items:{type:Array,required:true},itemsToShow:{type:Array},group:{type:p.GroupData,required:true},searching:{type:Boolean,default:false}},computed:{...r.mapState(P,["filtersApplied","shouldShowWelcomeStub"]),showAdvice(){return this.group&&d.Type.isStringFilled(this.group.adviceTitle)&&!this.searching},hasItems(){return this.group&&this.items.length>0},showWelcomeStub(){return this.showNoSelectedGroupStub&&this.shouldShowWelcomeStub},showNoSelectedGroupStub(){return!this.group&&!this.searching},showFiltersStub(){const t=!!this.$slots["main-content-filter-stub-title"];return t&&this.hasItems&&this.filtersApplied&&this.itemsToShow.length<=0},showSearchStub(){return(!this.group||this.hasItems)&&this.searching&&this.itemsToShow.length<=0},showEmptyGroupStub(){return this.group&&this.itemsToShow.length===0},showSeparator(){return this.showAdvice&&this.items.length<=0}},beforeUpdate(){this.$refs.content.scrollTop=0},template:`\n\t\t<div class="ui-entity-catalog__main-content">\n\t\t\t<div class="ui-entity-catalog__main-content-head">\n\t\t\t\t<slot name="main-content-header"/>\n\t\t\t</div>\n\t\t\t<ItemListAdvice v-if="showAdvice" :groupData="group" />\n\n\t\t\t<hr class="ui-entity-catalog__main-separator" v-if="showSeparator">\n\n\t\t\t<div class="ui-entity-catalog__main-content-body" ref="content">\n\t\t\t\t<slot name="main-content-welcome-stub" v-if="showWelcomeStub"/>\n\t\t\t\t<slot name="main-content-no-selected-group-stub" v-else-if="showNoSelectedGroupStub"/>\n\t\t\t\t<slot name="main-content-filter-stub" v-if="showFiltersStub">\n\t\t\t\t\t<EmptyContent>\n\t\t\t\t\t\t<slot name="main-content-filter-stub-title"/>\n\t\t\t\t\t</EmptyContent>\n\t\t\t\t</slot>\n\t\t\t\t<slot name="main-content-search-stub" v-else-if="showSearchStub">\n\t\t\t\t\t<EmptyContent>\n\t\t\t\t\t\t<slot name="main-content-search-not-found-stub"/>\n\t\t\t\t\t</EmptyContent>\n\t\t\t\t</slot>\n\t\t\t\t<slot name="main-content-empty-group-stub" v-else-if="showEmptyGroupStub">\n\t\t\t\t\t<EmptyContent>\n\t\t\t\t\t\t<slot name="main-content-empty-group-stub-title"/>\n\t\t\t\t\t</EmptyContent> \n\t\t\t\t</slot>\n\t\t\t\t<ItemList v-else :items="itemsToShow">\n\t\t\t\t\t<template #item="itemSlotProps">\n\t\t\t\t\t\t<slot name="item" v-bind:itemData="itemSlotProps.itemData"/>\n\t\t\t\t\t</template>\n\t\t\t\t</ItemList>\n\t\t\t</div>\n\t\t</div>\n\t`};let F=t=>t,O,G;const w={emits:["onApplyFilters"],name:"ui-entity-catalog-titlebar-filter",props:{filters:{type:Array,required:true},multiple:{type:Boolean,default:false}},data(){return{appliedFilters:this.getAppliedFilters(),allFilters:this.filters}},methods:{showMenu(){c.MenuManager.create({id:"ui-entity-catalog-titlebar-filter-menu",bindElement:this.$el,minWidth:271,autoHide:true,contentColor:"white",draggable:false,cacheable:false,items:this.getItems()}).show()},getItems(){const t=[];for(const e in this.allFilters){const s=d.Tag.render(O||(O=F`
					<div style="display: flex">
						<div>${0}</div>
					</div>
				`),d.Text.encode(this.filters[e].text));if(this.allFilters[e].applied){d.Dom.append(d.Tag.render(G||(G=F`<div class="ui-entity-catalog__filter-block_selected"></div>`)),s)}t.push({html:s,onclick:(t,s)=>{if(this.allFilters[e].applied){delete this.appliedFilters[this.allFilters[e].id]}else{if(!this.multiple){this.clearAllAction()}this.appliedFilters[this.allFilters[e].id]=this.allFilters[e]}this.allFilters[e].applied=!this.allFilters[e].applied;this.$emit("onApplyFilters",new u.BaseEvent({data:this.appliedFilters}));s.getMenuWindow().close()}})}t.push({delimiter:true});t.push(this.getClearAllFilter());return t},getClearAllFilter(){return{html:`\n\t\t\t\t\t<div style="display: flex">\n\t\t\t\t\t\t<div>${d.Loc.getMessage("UI_JS_ENTITY_CATALOG_RESET_FILTER")}</div>\n\t\t\t\t\t</div>\n\t\t\t\t`,onclick:(t,e)=>{this.clearAllAction();this.$emit("onApplyFilters",new u.BaseEvent({data:this.appliedFilters}));e.getMenuWindow().close()}}},clearAllAction(){this.appliedFilters={};this.allFilters=this.allFilters.map((t=>({...t,applied:false})))},getAppliedFilters(){const t={};for(const e in this.filters){if(this.filters[e].applied){t[this.filters[e].id]=this.filters[e]}}if(Object.keys(t).length>0){this.$emit("onApplyFilters",new u.BaseEvent({data:t}))}return t}},template:`\n\t\t<div \n\t\t\t:class="{\n\t\t\t\t'ui-entity-catalog__titlebar_btn-filter': true,\n\t\t\t\t'--active': Object.keys(appliedFilters).length > 0\n\t\t\t}"\n\t\t\t@click="showMenu">\n\t\t</div>\n\t`};const B={emits:["onSearch"],name:"ui-entity-catalog-titlebar-search",data(){return{opened:false,debounceSearchHandler:null,queryString:"",showClearSearch:false}},watch:{queryString(t){this.showClearSearch=this.opened&&this.$refs["search-input"]&&d.Type.isStringFilled(t)}},created(){this.debounceSearchHandler=d.debounce((t=>{this.onSearch(t.target.value)}),255)},methods:{openSearch(){this.opened=true;this.$nextTick((()=>{this.$refs["search-input"].focus()}))},onSearch(t){this.queryString=t;this.$emit("onSearch",new u.BaseEvent({data:{queryString:t?t.toString():""}}))},clearSearch(){if(this.showClearSearch){this.$refs["search-input"].value="";this.onSearch("")}}},template:`\n\t\t<div class="ui-ctl ui-ctl-after-icon ui-ctl-w100 ui-ctl-round" @click.once="openSearch">\n\t\t\t<a \n\t\t\t\t:class="{\n\t\t\t\t\t'ui-ctl-after': true,\n\t\t\t\t\t'ui-ctl-icon-search': !showClearSearch,\n\t\t\t\t\t'ui-ctl-icon-clear': showClearSearch\n\t\t\t\t}"\n\t\t\t\t@click="clearSearch"\n\t\t\t/>\n\t\t\t<input\n\t\t\t\ttype="text"\n\t\t\t\tclass="ui-ctl-element ui-ctl-textbox"\n\t\t\t\tplaceholder="${d.Loc.getMessage("UI_JS_ENTITY_CATALOG_GROUP_LIST_SEARCH_PLACEHOLDER")}"\n\t\t\t\tref="search-input"\n\t\t\t\tv-if="opened"\n\t\t\t\t@input="debounceSearchHandler"\n\t\t\t/>\n\t\t</div>\n\t`};const E={name:"ui-entity-catalog-application",components:{MainGroups:v,MainContent:L,TitleBarFilter:w,Search:B},props:{recentGroupData:{type:h.GroupData,required:false},groups:{type:Array,required:true},items:{type:Array,required:true},showEmptyGroups:{type:Boolean,default:false},showRecentGroup:{type:Boolean,default:true},filterOptions:{type:Object,default:{filterItems:[],multiple:false}}},data(){var t,e,s;let i=null;for(const t of this.groups){i=t.find((t=>t.selected));if(i){break}}if(d.Type.isNil(i)&&(t=this.recentGroupData)!=null&&t.selected){var a;i={id:"recent",...(a=this.recentGroupData)!=null?a:{}}}return{selectedGroup:i,selectedGroupId:(e=(s=i)==null?void 0:s.id)!=null?e:null,shownItems:[],shownGroups:this.getDisplayedGroup(),lastSearchString:"",filters:[]}},computed:{itemsBySelectedGroupId(){var t;const e=this.items.filter((t=>t.groupIds.some((t=>t===this.selectedGroupId))));return(t=this.selectedGroup)!=null&&t.compare?e.sort(this.selectedGroup.compare):e},...r.mapWritableState(P,{searching:"searchApplied",filtersApplied:"filtersApplied",globalGroup:"currentGroup",shouldShowWelcomeStub:"shouldShowWelcomeStub"})},watch:{selectedGroup(){this.shouldShowWelcomeStub=false;this.globalGroup=this.selectedGroup},selectedGroupId(){if(this.searching){return}this.shownItems=this.itemsBySelectedGroupId;this.applyFilters()}},created(){this.shownItems=this.itemsBySelectedGroupId},methods:{getDisplayedGroup(){if(this.showEmptyGroups){return d.Runtime.clone(this.groups)}const t=new Set;this.items.forEach((e=>{e.groupIds.forEach((e=>{t.add(e)}))}));return this.groups.map((e=>e.filter((e=>t.has(e.id))))).filter((t=>t.length>0))},handleGroupSelected(t){var e;this.searching=false;(e=this.$refs.search)==null?void 0:e.clearSearch();this.selectedGroupId=t?t.id:null;this.selectedGroup=t!=null?t:null},onSearch(t){const e=t.getData().queryString.toLowerCase();this.lastSearchString=e;if(!d.Type.isStringFilled(e)){this.searching=false;this.shownItems=[];return}this.searching=true;this.selectedGroup=null;this.selectedGroupId=null;this.shownItems=this.items.filter((t=>{var s;return String(t.title).toLowerCase().includes(e)||String(t.description).toLowerCase().includes(e)||((s=t.tags)==null?void 0:s.some((t=>t===e)))}));this.applyFilters()},onApplyFilterClick(t){this.filters=t.getData();if(this.searching){this.onSearch(new u.BaseEvent({data:{queryString:this.lastSearchString}}));return}this.shownItems=this.itemsBySelectedGroupId;this.applyFilters()},applyFilters(){this.filtersApplied=Object.values(this.filters).length>0;for(const t in this.filters){this.shownItems=this.shownItems.filter(this.filters[t].action)}},getFilterNode(){return this.$root.$app.getPopup().getTitleContainer().querySelector('[data-role="titlebar-filter"]')},getSearchNode(){return this.$root.$app.getPopup().getTitleContainer().querySelector('[data-role="titlebar-search"]')},stopPropagation(t){t.stopPropagation()}},template:`\n\t\t<div class="ui-entity-catalog__main">\n\t\t\t<MainGroups\n\t\t\t\t:recent-group-data="this.recentGroupData"\n\t\t\t\t:groups="this.shownGroups"\n\t\t\t\t:show-recent-group="showRecentGroup"\n\t\t\t\t:searching="searching"\n\t\t\t\t@group-selected="handleGroupSelected"\n\t\t\t>\n\t\t\t\t<template #group-list-header>\n\t\t\t\t\t<slot name="group-list-header"/>\n\t\t\t\t</template>\n\t\t\t\t<template #group="groupSlotProps">\n\t\t\t\t\t<slot\n\t\t\t\t\t\tname="group"\n\t\t\t\t\t\tv-bind:groupData="groupSlotProps.groupData"\n\t\t\t\t\t\tv-bind:handleClick="groupSlotProps.handleClick"\n\t\t\t\t\t/>\n\t\t\t\t</template>\n\t\t\t\t<template #group-list-footer>\n\t\t\t\t\t<slot name="group-list-footer"/>\n\t\t\t\t</template>\n\t\t\t</MainGroups>\n\t\t\t<MainContent\n\t\t\t\t:items="itemsBySelectedGroupId"\n\t\t\t\t:items-to-show="shownItems"\n\t\t\t\t:group="selectedGroup"\n\t\t\t\t:searching="searching"\n\t\t\t>\n\t\t\t\t<template #main-content-header>\n\t\t\t\t\t<slot name="main-content-header"/>\n\t\t\t\t</template>\n\t\t\t\t<template #main-content-no-selected-group-stub>\n\t\t\t\t\t<slot name="main-content-no-selected-group-stub"/>\n\t\t\t\t</template>\n\t\t\t\t<template #main-content-welcome-stub>\n\t\t\t\t\t<slot name="main-content-welcome-stub"/>\n\t\t\t\t</template>\n\t\t\t\t<template #main-content-filter-stub v-if="$slots['main-content-filter-stub']">\n\t\t\t\t\t<slot name="main-content-filter-stub"/>\n\t\t\t\t</template>\n\t\t\t\t<template #main-content-filter-stub-title v-if="$slots['main-content-filter-stub-title']">\n\t\t\t\t\t<slot name="main-content-filter-stub-title"/>\n\t\t\t\t</template>\n\t\t\t\t<template #main-content-search-not-found-stub>\n\t\t\t\t\t<slot name="main-content-search-not-found-stub"/>\n\t\t\t\t</template>\n\t\t\t\t<template #main-content-empty-group-stub>\n\t\t\t\t\t<slot name="main-content-empty-group-stub"/>\n\t\t\t\t</template>\n\t\t\t\t<template #main-content-empty-group-stub-title>\n\t\t\t\t\t<slot name="main-content-empty-group-stub-title"/>\n\t\t\t\t</template>\n\t\t\t\t<template #item="itemSlotProps">\n\t\t\t\t\t<slot name="item" v-bind:itemData="itemSlotProps.itemData"/>\n\t\t\t\t</template>\n\t\t\t</MainContent>\n\t\t\t<Teleport v-if="getFilterNode()" :to="getFilterNode()">\n\t\t\t\t<TitleBarFilter\n\t\t\t\t\t:filters="filterOptions.filterItems"\n\t\t\t\t\t:multiple="filterOptions.multiple"\n\t\t\t\t\t@onApplyFilters="onApplyFilterClick"\n\t\t\t\t\t@mousedown="stopPropagation"\n\t\t\t\t/>\n\t\t\t</Teleport>\n\t\t\t<Teleport v-if="getSearchNode()" :to="getSearchNode()">\n\t\t\t\t<Search @onSearch="onSearch" ref="search" @mousedown="stopPropagation"/>\n\t\t\t</Teleport>\n\t\t</div>\n\t`};let I=t=>t,A,D;const H={EmptyContent:S};const C={useGlobalState:P};var N=babelHelpers.classPrivateFieldLooseKey("popup");var U=babelHelpers.classPrivateFieldLooseKey("popupOptions");var R=babelHelpers.classPrivateFieldLooseKey("popupTitle");var M=babelHelpers.classPrivateFieldLooseKey("customTitleBar");var $=babelHelpers.classPrivateFieldLooseKey("groups");var k=babelHelpers.classPrivateFieldLooseKey("items");var j=babelHelpers.classPrivateFieldLooseKey("recentGroupData");var q=babelHelpers.classPrivateFieldLooseKey("showEmptyGroups");var x=babelHelpers.classPrivateFieldLooseKey("showRecentGroup");var X=babelHelpers.classPrivateFieldLooseKey("showSearch");var K=babelHelpers.classPrivateFieldLooseKey("filterOptions");var W=babelHelpers.classPrivateFieldLooseKey("application");var Y=babelHelpers.classPrivateFieldLooseKey("slots");var V=babelHelpers.classPrivateFieldLooseKey("customComponents");var J=babelHelpers.classPrivateFieldLooseKey("attachTemplate");var Z=babelHelpers.classPrivateFieldLooseKey("getDefaultPopupOptions");var z=babelHelpers.classPrivateFieldLooseKey("getPopupTitleBar");var Q=babelHelpers.classPrivateFieldLooseKey("handleClose");class tt extends u.EventEmitter{constructor(t){var e,s;super();Object.defineProperty(this,Q,{value:at});Object.defineProperty(this,z,{value:it});Object.defineProperty(this,Z,{value:st});Object.defineProperty(this,J,{value:et});Object.defineProperty(this,N,{writable:true,value:void 0});Object.defineProperty(this,U,{writable:true,value:void 0});Object.defineProperty(this,R,{writable:true,value:void 0});Object.defineProperty(this,M,{writable:true,value:null});Object.defineProperty(this,$,{writable:true,value:[]});Object.defineProperty(this,k,{writable:true,value:[]});Object.defineProperty(this,j,{writable:true,value:void 0});Object.defineProperty(this,q,{writable:true,value:false});Object.defineProperty(this,x,{writable:true,value:false});Object.defineProperty(this,X,{writable:true,value:false});Object.defineProperty(this,K,{writable:true,value:{filterItems:[],multiple:false}});Object.defineProperty(this,W,{writable:true,value:void 0});Object.defineProperty(this,Y,{writable:true,value:void 0});Object.defineProperty(this,V,{writable:true,value:void 0});this.setEventNamespace("BX.UI.EntityCatalog");this.setGroups(d.Type.isArray(t.groups)?t.groups:[]);this.setItems(d.Type.isArray(t.items)?t.items:[]);babelHelpers.classPrivateFieldLooseBase(this,j)[j]=t.recentGroupData;if(d.Type.isBoolean(t.canDeselectGroups)){babelHelpers.classPrivateFieldLooseBase(this,$)[$].forEach((e=>{e.forEach((e=>{e.deselectable=t.canDeselectGroups}))}))}babelHelpers.classPrivateFieldLooseBase(this,q)[q]=d.Type.isBoolean(t.showEmptyGroups)?t.showEmptyGroups:false;babelHelpers.classPrivateFieldLooseBase(this,x)[x]=d.Type.isBoolean(t.showRecentGroup)?t.showRecentGroup:false;babelHelpers.classPrivateFieldLooseBase(this,X)[X]=d.Type.isBoolean(t.showSearch)?t.showSearch:false;if(d.Type.isPlainObject(t.filterOptions)){babelHelpers.classPrivateFieldLooseBase(this,K)[K]=t.filterOptions}babelHelpers.classPrivateFieldLooseBase(this,R)[R]=d.Type.isString(t.title)?t.title:"";babelHelpers.classPrivateFieldLooseBase(this,M)[M]=t.customTitleBar?t.customTitleBar:null;babelHelpers.classPrivateFieldLooseBase(this,U)[U]=Object.assign(babelHelpers.classPrivateFieldLooseBase(this,Z)[Z](),d.Type.isObject(t.popupOptions)?t.popupOptions:{});babelHelpers.classPrivateFieldLooseBase(this,Y)[Y]=(e=t.slots)!=null?e:{};babelHelpers.classPrivateFieldLooseBase(this,V)[V]=(s=t.customComponents)!=null?s:{};this.subscribeFromOptions(t.events)}setGroups(t){babelHelpers.classPrivateFieldLooseBase(this,$)[$]=t.map((t=>{if(!d.Type.isArray(t)){t=[t]}return t.map((t=>({selected:false,deselectable:true,...t})))}));return this}getItems(){return babelHelpers.classPrivateFieldLooseBase(this,k)[k]}setItems(t){t=t.map((t=>({button:{},...t})));babelHelpers.classPrivateFieldLooseBase(this,k)[k].length=0;babelHelpers.classPrivateFieldLooseBase(this,k)[k].push(...t);return this}show(){babelHelpers.classPrivateFieldLooseBase(this,J)[J]();this.getPopup().show()}isShown(){return babelHelpers.classPrivateFieldLooseBase(this,N)[N]&&babelHelpers.classPrivateFieldLooseBase(this,N)[N].isShown()}getPopup(){if(d.Type.isNil(babelHelpers.classPrivateFieldLooseBase(this,N)[N])){babelHelpers.classPrivateFieldLooseBase(this,N)[N]=new c.Popup(babelHelpers.classPrivateFieldLooseBase(this,U)[U]);babelHelpers.classPrivateFieldLooseBase(this,N)[N].setResizeMode(true)}return babelHelpers.classPrivateFieldLooseBase(this,N)[N]}close(){babelHelpers.classPrivateFieldLooseBase(this,W)[W].unmount();this.getPopup().close()}}function et(){var t,i,a,l,n,o,p,c,u,h;const b=this;const g={recentGroupData:babelHelpers.classPrivateFieldLooseBase(this,j)[j],groups:babelHelpers.classPrivateFieldLooseBase(this,$)[$],items:babelHelpers.classPrivateFieldLooseBase(this,k)[k],showEmptyGroups:babelHelpers.classPrivateFieldLooseBase(this,q)[q],showRecentGroups:babelHelpers.classPrivateFieldLooseBase(this,x)[x],filterOptions:babelHelpers.classPrivateFieldLooseBase(this,K)[K]};babelHelpers.classPrivateFieldLooseBase(this,W)[W]=e.BitrixVue.createApp({name:"ui-entity-catalog",components:Object.assign(babelHelpers.classPrivateFieldLooseBase(this,V)[V],{Application:E,Hint:s.Hint,Button:T}),directives:{feedback:m},props:{recentGroupData:Object,groups:Array,items:Array,showEmptyGroups:Boolean,showRecentGroups:Boolean,filterOptions:Object},created(){this.$app=b},template:`\n\t\t\t\t\t<Application\n\t\t\t\t\t\t:recent-group-data="recentGroupData"\n\t\t\t\t\t\t:groups="groups"\n\t\t\t\t\t\t:items="items"\n\t\t\t\t\t\t:show-empty-groups="showEmptyGroups"\n\t\t\t\t\t\t:show-recent-group="showRecentGroups"\n\t\t\t\t\t\t:filter-options="filterOptions"\n\t\t\t\t\t>\n\t\t\t\t\t\t<template #group-list-header>\n\t\t\t\t\t\t\t${(t=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_GROUP_LIST_HEADER])!=null?t:""}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #group="groupSlotProps">\n\t\t\t\t\t\t\t${(i=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_GROUP])!=null?i:""}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #group-list-footer>\n\t\t\t\t\t\t\t${(a=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_GROUP_LIST_FOOTER])!=null?a:""}\n\t\t\t\t\t\t</template>\n\n\t\t\t\t\t\t<template #main-content-header>\n\t\t\t\t\t\t\t${(l=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_HEADER])!=null?l:""}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #main-content-filter-stub v-if="${!!babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_FILTERS_STUB]}">\n\t\t\t\t\t\t\t${babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_FILTERS_STUB]}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #main-content-filter-stub-title v-if="${!!babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_FILTERS_STUB_TITLE]}">\n\t\t\t\t\t\t\t${babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_FILTERS_STUB_TITLE]}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #main-content-search-not-found-stub>\n\t\t\t\t\t\t\t${(n=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_SEARCH_NOT_FOUND])!=null?n:d.Loc.getMessage("UI_JS_ENTITY_CATALOG_GROUP_LIST_ITEM_LIST_SEARCH_STUB_DEFAULT_TITLE")}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #main-content-welcome-stub>\n\t\t\t\t\t\t\t${(o=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_WELCOME_STUB])!=null?o:""}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #main-content-no-selected-group-stub>\n\t\t\t\t\t\t\t${(p=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_NO_SELECTED_GROUP_STUB])!=null?p:""}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #main-content-empty-group-stub>\n\t\t\t\t\t\t\t${(c=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_EMPTY_GROUP_STUB])!=null?c:""}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #main-content-empty-group-stub-title>\n\t\t\t\t\t\t\t${(u=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_EMPTY_GROUP_STUB_TITLE])!=null?u:""}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t\t<template #item="itemSlotProps">\n\t\t\t\t\t\t\t${(h=babelHelpers.classPrivateFieldLooseBase(this,Y)[Y][tt.SLOT_MAIN_CONTENT_ITEM])!=null?h:""}\n\t\t\t\t\t\t</template>\n\t\t\t\t\t</Application>\n\t\t\t\t`},g);babelHelpers.classPrivateFieldLooseBase(this,W)[W].use(r.createPinia()).mount(this.getPopup().getContentContainer())}function st(){return{className:"ui-catalog-popup ui-entity-catalog__scope",titleBar:babelHelpers.classPrivateFieldLooseBase(this,z)[z](),noAllPaddings:true,closeByEsc:true,contentBackground:tt.DEFAULT_POPUP_COLOR,draggable:true,width:tt.DEFAULT_POPUP_WIDTH,height:tt.DEFAULT_POPUP_HEIGHT,minWidth:tt.DEFAULT_POPUP_WIDTH,minHeight:tt.DEFAULT_POPUP_HEIGHT,autoHide:false}}function it(){const t=babelHelpers.classPrivateFieldLooseBase(this,M)[M]?babelHelpers.classPrivateFieldLooseBase(this,M)[M]:d.Tag.render(A||(A=I`<div>${0}</div>`),d.Text.encode(babelHelpers.classPrivateFieldLooseBase(this,R)[R]));return{content:d.Tag.render(D||(D=I`
				<div class="popup-window-titlebar-text ui-entity-catalog-popup-titlebar">
					${0}
					
					${0}
					${0}
					<span
						class="popup-window-close-icon popup-window-titlebar-close-icon"
						onclick="${0}"
						></span>
				</div>
			`),t,babelHelpers.classPrivateFieldLooseBase(this,X)[X]?`<div class="ui-entity-catalog__titlebar_search" data-role="titlebar-search"></div>`:"",babelHelpers.classPrivateFieldLooseBase(this,K)[K].filterItems.length>0?'<div data-role="titlebar-filter"></div>':"",babelHelpers.classPrivateFieldLooseBase(this,Q)[Q].bind(this))}}function at(){this.close()}tt.DEFAULT_POPUP_WIDTH=881;tt.DEFAULT_POPUP_HEIGHT=621;tt.DEFAULT_POPUP_COLOR="#edeef0";tt.SLOT_GROUP_LIST_HEADER="group-list-header";tt.SLOT_GROUP="group";tt.SLOT_GROUP_LIST_FOOTER="group-list-footer";tt.SLOT_MAIN_CONTENT_HEADER="main-content-header";tt.SLOT_MAIN_CONTENT_FILTERS_STUB="main-content-filter-stub";tt.SLOT_MAIN_CONTENT_FILTERS_STUB_TITLE="main-content-filter-stub-title";tt.SLOT_MAIN_CONTENT_SEARCH_NOT_FOUND="search-not-found";tt.SLOT_MAIN_CONTENT_WELCOME_STUB="main-content-welcome-stub";tt.SLOT_MAIN_CONTENT_NO_SELECTED_GROUP_STUB="main-content-no-selected-group-stub";tt.SLOT_MAIN_CONTENT_EMPTY_GROUP_STUB="main-content-empty-group-stub";tt.SLOT_MAIN_CONTENT_EMPTY_GROUP_STUB_TITLE="main-content-empty-group-stub-title";tt.SLOT_MAIN_CONTENT_ITEM="main-content-item";t.Stubs=H;t.States=C;t.EntityCatalog=tt})(this.BX.UI=this.BX.UI||{},BX.Vue3,BX.Vue3.Components,BX,BX,BX.Ui,BX,BX,BX.Vue3.Pinia,BX,BX.Main,BX.Event,BX,BX);
//# sourceMappingURL=entity-catalog.bundle.map.js